<template>
  <div class="footer">
    <div class="footer-in">
      <div class="back" @click="handleToTop">{{ $t('common.footer.backToTop') }}</div>
      <div v-for="(item, index) in filterMenus" :key="index" class="menu">
        <div class="m-row" @click="handleExtend(item)">
          <span>{{ item[lang] }}</span>
          <span class="arrow-right"></span>
        </div>
      </div>
      <div class="chart">
        <div class="chart-in">
          <img src="@/assets/images/index/Wechat.png" alt="" />
          <div class="hover-box">
            <img
              src="http://bepai-sotenowe.oss.bepai.net/source/on-line/%E4%BA%8C%E7%BB%B4%E7%A0%81.jpg"
              alt=""
            />
          </div>
        </div>
        <div class="chart-in">
          <img src="@/assets/images/index/Telephone.png" alt="" @click="handleJumpWhatsapp" />
          <div class="hover-span">
            <span>177 8203 0739</span>
          </div>
        </div>
      </div>
      <img
        :src="
          lang === 'en'
            ? require('@/assets/images/sotenLogo_en.svg')
            : require('@/assets/images/sotenLogo.png')
        "
        alt=""
        class="logo"
      />
    </div>
    <div class="copyright">
      <p>
        {{ $t('common.footer.copyright') }}
      </p>
      <div class="link">
        <el-dropdown v-if="userInfo.name" trigger="click" @command="handleCommand">
          <span class="cursor-pointer el-dropdown-link">
            &nbsp;{{ userInfo.name }}<i class="el-icon-arrow-down el-icon--right"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item command="logout">{{ $t('login.signOut') }}</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        <template v-else>
          <span class="cursor-pointer" @click="handleShowDialog('registered')">
            &nbsp;{{ $t('index.register') }}
          </span>
          <span>/</span>
          <span class="cursor-pointer" @click="handleShowDialog('login')">
            {{ $t('index.loginin') }}
          </span>
        </template>
      </div>
      <!-- <nuxt-link
        v-for="(locale, i) in showLocales"
        :key="i"
        :to="switchLocalePath(locale.code)"
        class="link"
      >
        <span @click="handleChangeLang(locale.code)">{{ locale.name }}</span>
      </nuxt-link> -->
    </div>
    <div v-if="visible" class="registered-dialog">
      <div v-if="type === 'login'" class="sign-in">
        <div class="close">
          <i class="el-icon-circle-close" @click="hide()"></i>
        </div>
        <div class="sign-in-head">
          <span class="ft-36 ft-bold blue">{{ $t('login.loginin') }}</span>
          <span class="ft-24" @click="handleChangeType('registered')">
            {{ $t('login.registered') }}
          </span>
        </div>
        <div class="sign-in-title blue">{{ $t('login.inputEmail') }}</div>
        <div class="navbar-box">
          <el-form ref="form" :model="form" :rules="loginRules" label-position="top">
            <el-form-item label="" prop="username">
              <el-input
                v-model="form.username"
                prefix-icon="el-icon-message"
                :placeholder="$t('login.userId')"
              ></el-input>
              <span class="grey">{{ $t('login.id') }}</span>
            </el-form-item>
            <el-form-item label="" prop="password">
              <el-input
                v-model="form.password"
                type="password"
                prefix-icon="el-icon-lock"
                :placeholder="$t('login.password')"
              ></el-input>
            </el-form-item>
          </el-form>
          <div class="ft-16">
            <span>
              {{ $t('login.forgetPwd') }}?
              <em class="blue" @click="handleChangeType('resetPassword')">
                {{ $t('login.resetPwd') }}
              </em>
            </span>
          </div>
          <div class="ft-16 tx-center">
            <el-button class="submit" @click="login">{{ $t('common.submit') }}</el-button>
            <span class="tx-center">
              {{ $t('login.noLogin') }}？
              <em class="blue" @click="handleChangeType('registered')">
                {{ $t('login.registered') }}
              </em>
            </span>
          </div>
        </div>
      </div>
      <div v-if="type === 'registered'" class="sign-in">
        <div class="close">
          <i class="el-icon-circle-close" @click="hide()"></i>
        </div>
        <div class="sign-in-head">
          <span class="ft-36 ft-bold blue">{{ $t('login.registered') }}</span>
          <span class="ft-24" @click="handleChangeType('login')">
            {{ $t('login.loginin') }}
          </span>
        </div>
        <div class="sign-in-title blue">{{ active + 1 }}.{{ tabs[active][lang] }}</div>
        <div v-if="active === 0" class="navbar-box">
          <el-form ref="form0" :model="form" :rules="rules" label-position="top">
            <el-form-item prop="email" label="">
              <el-input
                v-model="form.email"
                prefix-icon="el-icon-message"
                :placeholder="$t('login.emailAdress')"
              ></el-input>
            </el-form-item>
            <el-form-item prop="repeatEmail" label="">
              <el-input
                v-model="form.repeatEmail"
                prefix-icon="el-icon-lock"
                :placeholder="$t('login.confirmAdress')"
              ></el-input>
            </el-form-item>
          </el-form>
          <div class="ft-16">
            <el-button :loading="loading" class="submit" @click="handleSure">
              {{ $t('common.next') }}
            </el-button>
            <span>
              {{ $t('login.hasLogin') }}？<em class="blue" @click="handleChangeType('login')">{{
                $t('login.loginin')
              }}</em>
            </span>
          </div>
        </div>
        <div v-if="active === 1" class="navbar-box">
          <el-form ref="form1" :model="form" :rules="rules" label-position="top">
            <el-form-item prop="code" label="">
              <el-input
                v-model="form.code"
                prefix-icon="el-icon-message"
                :placeholder="$t('login.inputCode')"
              ></el-input>
            </el-form-item>
          </el-form>
          <div class="ft-16">
            <el-button :loading="loading" class="submit" @click="handleSure">
              {{ $t('common.next') }}
            </el-button>
            <span>
              {{ $t('login.hasLogin') }}？<em class="blue" @click="handleChangeType('login')">{{
                $t('login.loginin')
              }}</em>
            </span>
          </div>
        </div>
        <div v-if="active === 2" class="navbar-box">
          <el-form ref="form2" :model="form" :rules="rules" label-position="top">
            <el-form-item prop="nickname" label="">
              <el-input
                v-model="form.nickname"
                prefix-icon="el-icon-user"
                :placeholder="$t('login.inputNickname')"
              ></el-input>
            </el-form-item>
            <el-form-item prop="password" label="">
              <el-input
                v-model="form.password"
                type="password"
                prefix-icon="el-icon-lock"
                :placeholder="$t('login.inputPassword')"
              ></el-input>
            </el-form-item>
          </el-form>
          <div class="ft-16">
            <el-button :loading="loading" class="submit" @click="handleSure">
              {{ $t('common.next') }}
            </el-button>
            <span>
              {{ $t('login.hasLogin') }}？<em class="blue" @click="handleChangeType('login')">{{
                $t('login.loginin')
              }}</em>
            </span>
          </div>
        </div>
        <div v-if="active === 3" class="navbar-box info">
          <div>
            <div class="gender" @click="changeGender">
              <div class="gender-in" :class="{ active: form.sex }">
                <span>{{ $t('common.form.mr') }}</span>
                <em></em>
              </div>
              <div class="gender-in" :class="{ active: !form.sex }">
                <span>{{ $t('common.form.ms') }}</span>
                <em></em>
              </div>
            </div>
            <el-form ref="form3" :model="form" :rules="rules" label-position="top">
              <el-form-item prop="name" label="">
                <el-input v-model="form.name" :placeholder="$t('login.inputName')"></el-input>
              </el-form-item>
              <el-form-item prop="company" label="">
                <el-input v-model="form.company" :placeholder="$t('login.inputCompany')"></el-input>
              </el-form-item>
              <el-form-item prop="verticalMarket" label="">
                <el-input
                  v-model="form.verticalMarket"
                  :placeholder="$t('login.inputVerticalMarket')"
                ></el-input>
              </el-form-item>
              <el-form-item prop="phone" label="">
                <el-input v-model="form.phone" :placeholder="$t('login.inputPhone')"></el-input>
              </el-form-item>
              <el-form-item prop="area" label="">
                <el-input v-model="form.area" :placeholder="$t('login.inputRegion')"></el-input>
              </el-form-item>
              <el-form-item prop="howFind" label="">
                <el-input v-model="form.howFind" :placeholder="$t('login.inputHowFind')"></el-input>
              </el-form-item>
            </el-form>
          </div>
          <div class="ft-16">
            <el-button :loading="loading" class="submit" @click="handleSure">
              {{ $t('common.submit') }}
            </el-button>
            <span>
              {{ $t('login.hasLogin') }}？<em class="blue" @click="handleChangeType('login')">{{
                $t('login.loginin')
              }}</em>
            </span>
          </div>
        </div>
      </div>
      <div v-if="type === 'resetPassword'" class="sign-in">
        <div class="close">
          <i class="el-icon-circle-close" @click="hide()"></i>
        </div>
        <div class="sign-in-head">
          <span class="ft-36 ft-bold blue">{{ $t('login.resetPwd') }}</span>
          <span class="ft-24" @click="handleChangeType('registered')">
            {{ $t('login.registered') }}
          </span>
        </div>
        <div class="sign-in-title blue">{{ active + 1 }}.{{ restTabs[active][lang] }}</div>
        <div v-if="active === 0" class="navbar-box">
          <el-form ref="formReset0" :model="form" :rules="rules" label-position="top">
            <el-form-item prop="email" label="">
              <el-input
                v-model="form.email"
                prefix-icon="el-icon-message"
                :placeholder="$t('login.emailAdress')"
              ></el-input>
            </el-form-item>
            <el-form-item prop="repeatEmail" label="">
              <el-input
                v-model="form.repeatEmail"
                prefix-icon="el-icon-lock"
                :placeholder="$t('login.confirmAdress')"
              ></el-input>
            </el-form-item>
          </el-form>
          <div class="ft-16">
            <el-button :loading="loading" class="submit" @click="handleSure">
              {{ $t('common.next') }}
            </el-button>
            <span>
              {{ $t('login.hasLogin') }}？<em class="blue" @click="handleChangeType('login')">{{
                $t('login.loginin')
              }}</em>
            </span>
          </div>
        </div>
        <div v-if="active === 1" class="navbar-box">
          <el-form ref="formReset1" :model="form" :rules="rules" label-position="top">
            <el-form-item prop="code" label="">
              <el-input
                v-model="form.code"
                prefix-icon="el-icon-message"
                :placeholder="$t('login.inputCode')"
              ></el-input>
            </el-form-item>
          </el-form>
          <div class="ft-16">
            <el-button :loading="loading" class="submit" @click="handleSure">
              {{ $t('common.next') }}
            </el-button>
            <span>
              {{ $t('login.hasLogin') }}？<em class="blue" @click="handleChangeType('login')">{{
                $t('login.loginin')
              }}</em>
            </span>
          </div>
        </div>
        <div v-if="active === 2" class="navbar-box">
          <el-form ref="formReset2" :model="form" :rules="rules" label-position="top">
            <el-form-item prop="password" label="">
              <el-input
                v-model="form.password"
                prefix-icon="el-icon-lock"
                :placeholder="$t('login.inputNewPassword')"
              ></el-input>
            </el-form-item>
            <el-form-item prop="repeatPassword" label="">
              <el-input
                v-model="form.repeatPassword"
                prefix-icon="el-icon-lock"
                :placeholder="$t('login.confirmPassword')"
              ></el-input>
            </el-form-item>
          </el-form>
          <div class="ft-16">
            <el-button :loading="loading" class="submit" @click="handleSure">
              {{ $t('common.submit') }}
            </el-button>
            <span>
              {{ $t('login.hasLogin') }}？<em class="blue" @click="handleChangeType('login')">{{
                $t('login.loginin')
              }}</em>
            </span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
import * as api from '@/const/api'
import { email } from '@/utils/validator'

export default {
  data() {
    return {
      type: 'login', // type: registered | login | resetPassword
      form: {
        email: '',
        repeatEmail: '',
        code: '',
        nickname: '',
        password: '',
        repeatPassword: '',
        sex: true,
        name: '',
        company: '',
        verticalMarket: '',
        phone: '',
        area: '',
        howFind: '',
      },
      loginRules: {
        username: [
          {
            required: true,
            message: `${this.$t('common.input')}${this.$t('login.userId')}`,
            trigger: 'change',
          },
        ],
        password: [{ required: true, message: this.$t('login.inputPassword'), trigger: 'change' }],
      },
      tabs: [
        {
          en: 'Enter Your Email Address',
          zh: '输入您的邮件地址',
        },
        {
          en: 'Verify Your Email Address',
          zh: '验证您的电子邮件地址',
        },
        {
          en: 'Enter Your Information',
          zh: '输入您的信息',
        },
        {
          en: 'Enter Application Information',
          zh: '输入申请信息',
        },
      ],
      restTabs: [
        {
          en: 'Enter Your Email Address',
          zh: '输入您的邮件地址',
        },
        {
          en: 'Verify Your Email Address',
          zh: '验证您的电子邮件地址',
        },
        {
          en: 'Enter A New Password',
          zh: '输入新的密码',
        },
      ],
      visible: false,
      active: 0,
      loading: false,
    }
  },
  computed: {
    ...mapState(['menus', 'lang', 'isZh', 'userInfo']),
    showLocales() {
      return this.$i18n.locales.filter((locale) => locale.code !== this.$i18n.locale)
    },
    filterMenus() {
      return this.menus.filter((item) => item.path !== '/solution')
    },
    rules() {
      const rulesMap = {
        0: {
          email: [
            { required: true, message: this.$t('login.inputEmail'), trigger: 'change' },
            {
              pattern: email,
              message: this.$t('login.inputValidEmail'),
              trigger: 'blur',
            },
          ],
          repeatEmail: [
            {
              required: true,
              validator: (rule, value, callback) => {
                if (!value) {
                  return callback(new Error(this.$t('login.confirmAdress')))
                }

                if (value === this.form.email) {
                  callback()
                } else {
                  return callback(new Error(this.$t('login.reEnterAdress')))
                }
              },
              trigger: 'blur',
            },
          ],
        },
        1: {
          code: [{ required: true, message: this.$t('login.inputCode'), trigger: 'change' }],
        },
        2: {
          nickname: [
            { required: true, message: this.$t('login.inputNickname'), trigger: 'change' },
          ],
          password: [
            { required: true, message: this.$t('login.inputPassword'), trigger: 'change' },
          ],
          repeatPassword: [
            {
              required: true,
              validator: (rule, value, callback) => {
                if (!value) {
                  return callback(new Error(this.$t('login.confirmPassword')))
                }

                if (value === this.form.password) {
                  callback()
                } else {
                  return callback(new Error(this.$t('login.reEnterPassword')))
                }
              },
              trigger: 'change',
            },
          ],
        },
        3: {
          name: [{ required: true, message: this.$t('login.inputName'), trigger: 'change' }],
          company: [{ required: true, message: this.$t('login.inputCompany'), trigger: 'change' }],
          verticalMarket: [
            { required: true, message: this.$t('login.inputVerticalMarket'), trigger: 'change' },
          ],
          phone: [{ required: true, message: this.$t('login.inputPhone'), trigger: 'change' }],
          area: [{ required: true, message: this.$t('login.inputRegion'), trigger: 'change' }],
          howFind: [{ required: true, message: this.$t('login.inputHowFind'), trigger: 'change' }],
        },
      }
      return rulesMap[this.active]
    },
  },
  methods: {
    hide() {
      this.visible = false
    },
    async login() {
      try {
        await this.$refs.form.validate()
        const params = {
          username: this.form.username,
          password: this.form.password,
        }
        const { code, msg, data } = await this.$axios.$post(api.userLogin, params)

        if (+code !== 200) {
          throw new Error(msg || this.$t('common.form.error'))
        }
        this.$store.commit('update', {
          token: data.token,
          userInfo: data.userInfo,
        })
        this.$message.success(this.$t('login.loginSuccess'))
        this.$cookies.set('userInfo', data.userInfo)
        this.hide()
      } catch (err) {
        err.message && this.$message.error(err.message)
      } finally {
        this.loading = false
      }
    },
    async handleChangeType(type) {
      this.type = type
      this.active = 0

      await this.$nextTick()

      this.$refs.formReset0 && this.$refs.formReset0.clearValidate()
      this.$refs.form0 && this.$refs.form0.clearValidate()
      this.$refs.form && this.$refs.form.clearValidate()
      Object.keys(this.form).forEach((key) => {
        if (key !== 'sex') {
          this.$set(this.form, key, '')
        }
      })
    },
    async handleSure() {
      try {
        if (this.active === 0) {
          if (this.type === 'resetPassword') {
            await this.$refs[`formReset${this.active}`].validate()
          } else {
            await this.$refs[`form${this.active}`].validate()
          }

          this.loading = true
          const { code, msg } = await this.$axios.$post(api.mailSend, {
            email: this.form.email,
            lang: this.lang, // zh 或 en
          })
          if (+code !== 200) {
            throw new Error(msg || this.$t('common.form.error'))
          }
        }

        if (this.active === 1) {
          if (this.type === 'resetPassword') {
            await this.$refs[`formReset${this.active}`].validate()
          } else {
            await this.$refs[`form${this.active}`].validate()
          }
          this.loading = true
          const { code, msg } = await this.$axios.$post(api.mailValid, {
            email: this.form.email,
            code: this.form.code, // zh 或 en
          })
          if (+code !== 200) {
            throw new Error(msg || this.$t('common.form.error'))
          }
        }

        if (this.active === 2) {
          if (this.type === 'resetPassword') {
            await this.$refs[`formReset${this.active}`].validate()

            const { code, msg } = await this.$axios.$post(api.userModifyPassword, {
              username: this.form.email,
              password: this.form.password,
            })
            if (+code !== 200) {
              throw new Error(msg || this.$t('common.form.error'))
            }

            this.$message.success(this.$t('common.form.success'))
            this.hide()
          } else {
            await this.$refs[`form${this.active}`].validate()
          }
        }

        if (this.active === 3) {
          await this.$refs[`form${this.active}`].validate()

          this.loading = true

          const {
            email,
            password,
            area,
            company,
            howFind,
            verticalMarket,
            name,
            nickname,
            phone,
            sex,
          } = this.form
          const params = {
            username: email,
            password,
            accountEmail: email,
            area,
            company,
            howFind,
            name,
            nickname,
            phone,
            verticalMarket,
            sex: sex ? 1 : 0,
          }

          const { code, msg } = await this.$axios.$post(api.userRegister, params)
          if (+code !== 200) {
            throw new Error(msg || this.$t('common.form.error'))
          }

          this.$message.success(this.$t('common.form.success'))
          this.hide()
        }

        this.active++
      } catch (err) {
        err.message && this.$message.error(err.message)
      } finally {
        this.loading = false
      }
    },
    handleExtend(item) {
      const path = this.$route.path
      if (path === item.path || path === `/zh${item.path}`) {
        return
      }
      if (item.zh === '工作机会') {
        this.$router.push({
          path: '/work/join-us',
        })
        return
      }
      this.$router.push({
        path: item.path,
      })
    },
    handleChangeLang(lang) {
      this.$store.commit('update', {
        lang,
      })
      this.$cookies.set('lang', lang)
    },
    handleToTop() {
      this.$emit('toTop')
    },
    handleJumpWhatsapp() {
      if (this.isZh) {
        window.open('https://work.weixin.qq.com/ca/cawcdec2e016c3c426')
      } else {
        window.open('https://wa.me/8617782030739')
      }
    },
    handleShowDialog(type) {
      this.visible = true
      this.type = type
      Object.keys(this.form).forEach((key) => {
        if (key !== 'sex') {
          this.$set(this.form, key, '')
        }
      })
    },
    changeGender() {
      this.$set(this.form, 'sex', !this.form.sex)
    },
    handleCommand() {
      this.$store.commit('update', {
        userInfo: '',
        token: '',
      })
      this.$cookies.set('userInfo', '')
      this.$message.success(this.$t('login.logioutnSuccess'))
    },
  },
}
</script>

<style lang="less" scoped>
@import '~assets/var';

.footer {
  font-size: 28px;

  .footer-in {
    height: 900px;
    background: #151c2a;

    .back {
      color: #fff;
      text-align: center;
      padding-top: 44px;
      position: relative;

      &::before {
        content: '';
        display: block;
        position: absolute;
        width: 10px;
        height: 10px;
        border-radius: 2px;
        border-left: 1px solid #fff;
        border-top: 1px solid #fff;
        left: 50%;
        margin-left: -4px;
        top: 30px;
        transform: rotate(45deg);
      }
    }

    .menu {
      color: #fff;

      .m-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 50px;
        height: 96px;
        border-bottom: 1px solid #272e3b;
      }

      .arrow-right {
        position: relative;
        height: 100%;

        &::before {
          content: '';
          display: block;
          position: absolute;
          width: 10px;
          height: 10px;
          border-radius: 2px;
          border-left: 1px solid #fff;
          border-top: 1px solid #fff;
          left: 50%;
          top: 44px;
          transform: rotate(135deg);
        }
      }
    }

    .chart {
      padding: 40px 50px;

      .chart-in {
        position: relative;
        display: inline-block;
        margin-right: 18px;

        .hover-box {
          position: absolute;
          opacity: 0;
          transition: all 0.3s;
          top: 0;
          left: 50%;
          transform: translate(-50%);

          &::after {
            content: '';
            display: block;
            width: 0;
            height: 0;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-top: 6px solid #fff;
            position: absolute;
            bottom: -6px;
            left: 50%;
            transform: translate(-50%);
          }
        }

        .hover-span {
          width: 0;
          height: 0;
          font-size: 0;
          position: absolute;
          opacity: 0;
          transition: all 0.3s;
          top: 0;
          left: 50%;
          background-color: #fff;
          color: #0261bc;
          font-weight: bold;
          transform: translate(-50%, 0);
          text-align: center;
          border-radius: 10px;

          &::after {
            content: '';
            display: block;
            width: 0;
            height: 0;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-top: 10px solid #fff;
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translate(-50%);
          }
        }

        &:hover {
          .hover-box {
            width: 128px;
            height: 128px;
            top: -140px;
            opacity: 1;

            img {
              width: 128px;
              height: 128px;
              border-radius: 4px;
            }
          }

          .hover-span {
            width: 200px;
            height: 36px;
            line-height: 36px;
            top: -60px;
            font-size: 20px;
            opacity: 1;

            span {
              width: 200px;
              height: 36px;
              border-radius: 4px;
            }
          }
        }
      }

      img {
        width: 46px;
        height: 46px;
      }
    }

    .logo {
      width: 192px;
      height: 52px;
      margin: 10px 0 0 50px;
    }
  }

  .copyright {
    height: 150px;
    background-size: 100% 100%;
    background-image: url(@/assets/images/index/bg06.png);
    display: flex;
    color: #fff;
    padding: 0 50px;
    align-items: center;

    p {
      font-size: 18px;
      flex: 1;
    }

    .link {
      height: 54px;
      border: 1px solid #fff;
      border-radius: 27px;
      text-align: center;
      color: #fff;
      line-height: 50px;
      padding: 0 10px;

      .cursor-pointer {
        font-size: 24px;
        color: #fff;
        line-height: 50px;
      }
    }
  }

  .registered-dialog {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 21;
  }

  .sign-in {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 702px;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 20px;
    padding: 24px 24px 24px 24px;

    .close {
      font-size: 46px;
      float: right;
    }

    &-head {
      clear: both;
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 40px;
    }

    &-title {
      font-size: 24px;
      padding: 44px 0 0 0;
    }
  }

  .navbar-box {
    padding: 0 0 50px 0;

    .el-form {
      padding: 0 0 0 0;

      .el-form-item {
        margin: 0 0 30px 0;
      }

      :deep(.el-form-item__content) {
        line-height: 66px;
        margin: 50px 0 10px 0;
      }

      :deep(.el-input__inner) {
        line-height: 66px;
        height: 66px;
      }

      :deep(.el-input__icon) {
        line-height: 30px;
      }

      span {
        font-size: 22px;
        color: #999;
        text-align: right;
        display: block;
        position: absolute;
        right: 0;
        margin-top: -14px;
      }
    }

    .ft-16 {
      color: #666;
      font-size: 24px;
    }

    em {
      font-style: normal;
      cursor: pointer;
    }

    .submit {
      width: 654px;
      height: 66px;
      line-height: 66px;
      background: #0261bc;
      padding: 0;
      border-radius: 33px;
      color: #fff;
      font-size: 30px;
      font-weight: bold;
      margin: 70px 0 30px 0;
    }

    .tx-center {
      text-align: center;
    }

    &.info {
      .gender {
        font-size: 24px;
        display: flex;
        margin: 12px 0;

        .gender-in {
          display: flex;
          align-items: center;
          cursor: pointer;

          &.active {
            span {
              color: #075fc4;
            }

            em {
              background-image: url(@/assets/images/index/selected-active.png);
            }
          }

          em {
            display: inline-block;
            width: 20px;
            height: 20px;
            background-image: url(@/assets/images/index/selected.png);
            background-size: 100% 100%;
            margin: 0 20px 0 4px;
          }

          span {
            margin: 0;
          }
        }
      }

      .el-form {
        padding: 0;

        .el-form-item {
          margin: 0 0 0 0;
        }

        :deep(.el-form-item__content) {
          line-height: 66px;
          margin: 30px 0 10px 0;
        }

        :deep(.el-input__inner) {
          line-height: 66px;
          height: 66px;
        }

        :deep(.el-input__icon) {
          line-height: 30px;
        }
      }

      .submit {
        // .mg(4, 20, 0, 0);
      }
    }
  }
}
</style>
